<?php

$sql = "select link from tblhome_image where `show` =1";
$rs = mysql_query($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo ($lang==0)?"Trang chủ SDDS":"SDDS Homepage"?></title>
<link rel="stylesheet" type="text/css" href="<?php echo ROOT_PATH?>/css/cssw.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo ROOT_PATH?>/css/slide.css"/>
<script type="text/javascript" src="<?php echo ROOT_PATH?>/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo ROOT_PATH?>/js/jquery.timers.js"></script>
<script type="text/javascript" src="<?php echo ROOT_PATH?>/js/sdds.js"></script>
<script type="text/javascript" src="<?php echo ROOT_PATH?>/js/slide.js"></script>
<script type="text/javascript" src="<?php echo ROOT_PATH?>/js/ie6.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	var imgArray = $("#slider .images img");
	var numArrry = $("#slider ul li"); 
	var currImg =0;
	function setImg(){
		$("#slider .images img.actived").fadeOut(1000).removeClass("actived");
		delay(1000);
		imgArray.eq($("#slider ul li.actived").index()).fadeIn(1000).addClass("actived");
	}
	
	$("#slider ul li").hover(function(){
									  
		$("#slider .images img.actived").fadeOut(1000);
		
		imgArray.eq($(this).index()).fadeIn(2000).addClass("actived");
	},function(){
		setImg();
	}); 
	
	$("#langvi").click(function(){
		
		$.ajax({type:"GET",
				url:"<?php echo ROOT_PATH;?>/lang.php",
				data:"lang=0",
				success: function(data){
					alert(data);
					window.location.reload();
				}
		});
	});
	$("#langen").click(function(){
		
		$.ajax({type:"GET",
				url:"<?php echo ROOT_PATH;?>/lang.php",
				data:"lang=1",
				success: function(data){
					alert(data);
					window.location.reload();
				}
		});
	});
});

</script>
</head>
<body>

<div id="page">
    	<div id="header">
        	<div id="logo">
            </div>
            <div id="language">
            	<a href="#" id="langvi"><img src="images/flag_vi.jpg" border="0" /></a>
            	<a href="#" id="langen"><img src="images/flag_en.jpg" border="0"/></a>
            </div>
        </div>
        <div id="main">
        	<div id="left">
        		<!--Menu come here-->
        	<?php
        		include "menu.php"; 
        	?>
        	 </div>
            <div id="right">
            	<div id="slide-holder">
					<div id="slide-runner">
                    	<?php
							$i=1;
							while($image = mysql_fetch_object($rs)){
						?>
                    	<a href=""><img id="slide-img-<?php echo $i++;?>" src="<?php echo $image->link?>" class="slide" alt="" width="680" height="400"/></a>
                    	<?php
							}
						?>
                    </div>
					<div id="slide-controls">
					 	<p id="slide-nav"></p>
					</div>
				</div>
		
		<!--content featured gallery here -->
				</div>
				<script type="text/javascript">
				if(!window.slider) 
					var slider={};
					slider.data=[<?php
						$num = mysql_num_rows($rs);
						for($i=1;$i<=$num;$i++){
							echo "{'id':'slide-img-".$i."','client':'','desc':''}";
							if($i<$num) echo ",";
						}
						
					?>
				];
				</script>
                
            </div>
            
        
        <div id="footer">
			<div style="color:#006600;font-size:14px;font-weight:500;font-family:Arial;float:left;margin-left:60px;">
					Copyright &copy; MaxBuy Việt Nam 2010
			</div>
			
			<span class="line"></span>
			
			<div id="">
					<?php include "submenu.php";?>
			</div>
        </div>
    </div>
</body>
</html>
        	

